<html>
  <head>
    <title>Moderator API Example</title>
    <!-- common.js sets SERIES_ID and TOPIC_ID. -->
    <script src="common.js"></script>
  </head>
  <body>
    <p><a href="http://code.google.com/p/google-moderator-api-samples/source/browse/samples/web/jsonp/jsonp.submissions.list.dom.html">view source</a></p>
    <div id="content"></div>
    <script>
      function handleResponse(response) {
        document.getElementById("content").innerHTML += "<ul>";
        for (var i = 0; i < response.data.items.length; i++) {
          var item = response.data.items[i];
          document.getElementById("content").innerHTML += "<li>" + _hesc(item.text) + "</li>";
        }
        document.getElementById("content").innerHTML += "</ul>";
      }
      var script = document.createElement("script");
      script.setAttribute("src", "http://www.googleapis.com/moderator/v1/series/" + SERIES_ID + "/topics/" + TOPIC_ID + "/submissions?alt=json&callback=handleResponse");
      script.setAttribute("type", "text/javascript");
      document.body.appendChild(script);
    </script>
  </body>
</html>
